package cn.jobstart.config;

import cn.jobstart.config.swagger.SkDocket;
import com.github.xiaoymin.swaggerbootstrapui.annotations.EnableSwaggerBootstrapUI;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import springfox.documentation.RequestHandler;
import springfox.documentation.builders.RequestHandlerSelectors;
import springfox.documentation.spring.web.plugins.Docket;
import springfox.documentation.swagger2.annotations.EnableSwagger2;

import javax.annotation.Resource;

/**
 * @author sunke
 * @Date 2018/8/16 10:22
 * @description
 */
@Configuration
@EnableSwagger2
@EnableSwaggerBootstrapUI
public class Swagger2Config {




    @Resource
    private SkDocket skDocket;


    @Bean
    public Docket createRestApi() {
        com.google.common.base.Predicate<RequestHandler> selector1 = RequestHandlerSelectors.basePackage("cn.jobstart.pubInter");
          com.google.common.base.Predicate<RequestHandler> selector2 = RequestHandlerSelectors.basePackage("cn.jobstart.controller");
        com.google.common.base.Predicate<RequestHandler> selector3= RequestHandlerSelectors.basePackage("cn.jobstart.controller.test");
        return skDocket.getDocketInstanceByController("",selector1,selector2);
    }








}
